<div class="box">
  <div class="box-heading"><?php echo $heading_title?></div>
  <div class="box-content">
   <div class="category-list">
	    <?php if (count($categories) <= 5) { ?>
	    <ul>
	      <?php foreach ($categories as $category) { ?>
	      <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></li>
	      <?php } ?>
	    </ul>
	    <?php } else { ?>
	    <?php for ($i = 0; $i < count($categories);) { ?>
	    <ul>
	      <?php $j = $i + ceil(count($categories) / 4); ?>
	      <?php for (; $i < $j; $i++) { ?>
	      <?php if (isset($categories[$i])) { ?>
	      <li><a href="<?php echo $categories[$i]['href']; ?>"><?php echo $categories[$i]['name']; ?></a></li>
	      <?php } ?>
	      <?php } ?>
	    </ul>
	    <?php } ?>
	    <?php } ?>
  </div>
  </div>
</div>
